

package com.hazelcast.client.impl.spi;

import com.hazelcast.client.config.RoutingMode;
import com.hazelcast.client.impl.spi.impl.ListenerMessageCodec;

import javax.annotation.Nonnull;
import java.util.UUID;

/**
 * Client service to add/remove remote listeners.
 * <p>
 * For {@link RoutingMode#ALL_MEMBERS} routing clients, it registers local listeners to all nodes in cluster.
 * For all other clients, it registers a global listener to one node.
 */
public interface ClientListenerService {

    @Nonnull
    UUID registerListener(ListenerMessageCodec listenerMessageCodec, EventHandler handler);

    boolean deregisterListener(@Nonnull UUID registrationId);

}
